<template>
	<view class="cardstyle">
		<view class="titlebox">
			<view class="imgbox">
				<image src="/static/logo.png" style="width: 50rpx;height: 50rpx;" v-if="mode==2" ></image>
			</view>
		<view>
		<text>{{title}}</text>
		</view>
	</view>
		<view class="tipsbox">
			<text v-if="isTop" style="color: #f00; margin-right: 20rpx;">置顶</text>
			<text style="color: lightgray;margin-right: 20rpx;">{{author}}</text>
			<text style="color: lightgray;">{{comments}}评</text>
			<view style="flex: 1; display:flex; justify-content: flex-end; color: lightgray;">
				<text>{{time}}</text>
			</view>	
		</view>
		<slot name="tips"></slot>
		<slot name="footer"></slot>
	</view>
</template>

<script>
	export default {
		name: "newsView",
		props:{
			bgColor:{
				type:String,
				default:"#fff"
			},
			nid:{
				type:String,
				default:"000",
				require:true
			},
			title:{
				type:String,
				default:"新闻标题",
				require:true
			},
			mode:{
				type:Number,
				default:1,
				require:true
			},
			isTop:{
				type:Boolean,
				default:false,
				require:true
			},
			author:{
				type:String,
				default:"来源",
				require:true
			},
			comments:{
				type:Number,
				default:0,
				require:true
			},
			time:{
				type:String,
				default:"2025.10.28"
			},
			imagesssss:{
				type:String,
				default:""
			},
			showSearch:{
				type:Boolean,
				default:false
			},
			images:{
				type:Array,
				default:()=>[]
			}
		}
	
	}
</script>

<style>
.cardstyle {
		background-color: aqua;
		border-radius: 20rpx;
		padding: 20rpx;
		margin-bottom: 10rpx;
	}

	.titlebox {
		font-size: 30rpx;
		font-weight: 500;
		margin-bottom: 15rpx;
		display: block;
		line-height: 1.4;
	}
	.tipsbox{
		font-size:20rpx;
		display: flex;
		align-items: center;
			margin-bottom: 10rpx;
	}
</style>